﻿function saveUFV(date, amount) {
    var parametros = {
        fecha: date,
        valor: amount
    };
    var url = "content/index.aspx/saveUFV";
    var paramString = JSON.stringify(parametros);
    var result = '';
    $.ajax({
        url: url,
        async: false,
        data: paramString,
        dataType: 'json',
        type: 'POST',
        contentType: 'application/json; charset=utf-8',
        success: function (data) {
            result = data.d;
        },
        error: function (data) {
            alert('something went wrong');
        }
    });

    return result;
}

function updateUFV(date, amount) {
    var parametros = {
        fecha: date,
        valor: amount
    };
    var url = "content/index.aspx/updateUFV";
    var paramString = JSON.stringify(parametros);
    var result = '';
    $.ajax({
        url: url,
        async: false,
        data: paramString,
        dataType: 'json',
        type: 'POST',
        contentType: 'application/json; charset=utf-8',
        success: function (data) {
            result = data.d;
        },
        error: function (data) {
            alert('something went wrong');
        }
    });

    return result;
}